const routes = [
  {
    path: '/',
    name: 'Layout',
    redirect: '/login',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '首页'
    },
    children: [
      {
        path: '/login',
        name: 'Login',
        component: () => import('@/views/login/index.vue'),
        meta: {
          title: '手机号验证',
        }
      },
      {
        path: '/order',
        name: 'Order',
        redirect: '/order/list',
        component: () => import('@/views/order/index.vue'),
        meta: {
          title: '我的订单',
        },
        children: [{
          path: 'list',
          name: 'OrderList',
          component: () => import('@/views/order/list.vue'),
          meta: {
            title: '我的订单',
          },
        },
        {
          path: 'detail',
          name: 'OrderDetail',
          component: () => import('@/views/order/detail.vue'),
          meta: {
            title: '订单详情',
            noCache: true,
            hasHeader: true,
          }
        },
        {
          path: 'edit',
          name: 'OrderEdit',
          component: () => import('@/views/order/edit.vue'),
          meta: {
            title: '信息修改',
            hasHeader: true,
          }
        },
        {
          path: 'map',
          name: 'OrderMap',
          component: () => import('@/views/map/index.vue'),
          meta: {
            title: '定位',
          }
        }]
      }
    ]
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/order/list',
  }
]

export default routes
